package 网易机试;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class 第一题1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine();
            System.out.println(func(s));
        }
        sc.close();
    }

    private static int func(String s) {
        if (s.length() == 1)
            return 1;
        char[] a = s.toCharArray();
        ArrayList<Integer> list = new ArrayList<>();
        int r = 1;
        for (int i = 0; i < a.length - 1; i++) {
            if (a[i + 1] == a[i]) {
                list.add(r);
                r = 1;
            }
            if (a[i + 1] != a[i]) {
                r++;
            }
        }
        list.add(r);
        System.out.println(list);
        return Collections.max(list);
    }

}
